<div class='definition'><pre>class</pre></div>
<div class='content'><p><span class="seoSummary">The <code><strong>class</strong></code> <a href="https://developer.mozilla.org/en-us/docs/Web/HTML/Global_attributes">global attribute</a> is a space-separated list of the case-sensitive classes of the element. Classes allow CSS and Javascript to select and access specific elements via the <a href="https://developer.mozilla.org/en-us/docs/Web/CSS/Class_selectors">class selectors</a> or functions like the DOM method <a href="https://developer.mozilla.org/en-us/docs/Web/API/Document/getElementsByClassName"><code>document.getElementsByClassName</code></a>.</span></p>
<p>Though the specification doesn't put requirements on the name of classes, web developers are encouraged to use names that describe the semantic purpose of the element, rather than the presentation of the element. For example, <em>attribute</em> to describe an attribute rather than <em>italics</em>, although an element of this class may be presented by <em>italics</em>. Semantic names remain logical even if the presentation of the page changes.</p></div>
<table class='sections'>
<tr><td valign='top' class='section'><p>Supported by:</td><td valign='top'>Chrome, Chrome Android, Edge, Firefox 32, IE, Opera, Safari, Safari iOS</td></table>
<div class='content'>By <a href='https://developer.mozilla.org/en-us/docs/web/html/global_attributes/class/contributors.txt'>Mozilla Contributors</a>, <a href='https://creativecommons.org/licenses/by-sa/2.5/'>CC BY-SA 2.5</a></div>